from datetime import timedelta

import pymysql
from DBUtils.PooledDB import PooledDB
from redis import Redis


class Config(object):
    DEBUG = True
    SECRET_KEY = 'sdhfo'
    PERMANENT_SESSION_LIFETIME = timedelta(minutes=20)  # Cookie失效时间
    SESSION_REFRESH_EACH_REQUEST = True
    # SESSION_TYPE = 'redis'
    PYMYSQL_HOST = 'localhost'


class ProductionConfig(Config):
    # SESSION_REDIS = Redis(host='192.168.0.94', port='6379')
    pass


class DevelopmentConfig(Config):
    # SESSION_REDIS = Redis(host='127.0.0.1', port='6379')
    pass


class TestingConfig(Config):
    pass
